package com.fourth_groups.shopping121store.ui.person.view;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.Window;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.fourth_groups.shopping121store.R;

public class Linear_userxyActivity extends AppCompatActivity {
    private WebView wb_user;
    String url="http://qiniu.kefu.121dian.com/client/?orgid=730&uid=1548964&sign=8e3d7fdffc37e4b1561ca897c3b61193&site_id=1&chat_params=%7B%22type%22%3A0%2C%22site_id%22%3A%221%22%7D&trace_data=%7B%22position%22%3A%229.9.9%22%7D&offiName=121店官方客服";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_linear_userxy);
        wb_user = (WebView) findViewById(R.id.linear_userxywv);

        wb_user.loadUrl(url);
        wb_user.getSettings().setJavaScriptEnabled(true);
        wb_user.setWebViewClient(new WebViewClient(){
            @Override
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                wb_user.loadUrl(url);
                return true;
            }
        });
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if ((keyCode == KeyEvent.KEYCODE_BACK) && wb_user.canGoBack()) {
            wb_user.goBack();
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }
    }


